<template>
  <view style="height: 100%">
    <x-list-page title="ttt"
                 ref="XListPage"
                 :queryData="getList"
                 :show-navbar="false"
                 :tabList="tabList"
                 @handleFilter="handleFilter"
                 @search="search"
                 @change="change"
                 @input="input">
      <template v-slot:cardItem="{item}">
        <view>{{item.index}}</view>
      </template>
    </x-list-page>
  </view>
</template>

<script>
import XListPage from '../uni_modules/x-list-page/components/x-list-page'

export default {
  name: "x-list-page-view",
  components: {
    XListPage
  },
  data() {
    return {
      show: false,
      params: {
        orderNo: '',
        startTime: '',
        endTime: '',
        deptName: '',
        reason: ''
      },
      propsOptions: {
        value: 'dictKey',
        label: 'name'
      },
      selectValue: {
        useCarType: [],
        allowCarpooling: [],
        status: []
      },
      useCarTypes: [],
      weatherCommon: [],
      carApplyStatus: [],
      tabList: [
        {
          name: '全部',
          status: '',
          dataCode: '',
          data: []
        },
        {
          name: '未提交',
          status: 'draft',
          dataCode: '',
          data: []
        },
        {
          name: '审批中',
          status: 'reviewing',
          dataCode: '',
          data: []
        },
        {
          name: '审批通过',
          status: 'pass',
          dataCode: '',
          data: []
        }
      ]
    }
  },
  onLoad() {
	  this.$nextTick(() => {
		  this.$refs.XListPage.handleGetList();
	  })
  },
  methods: {
    reset() {
      this.$refs.XListPage.handleGetList();
    },
    getList({page}) {
      return new Promise(resolve => {
        resolve({
          list: [{index: 1}, {index: 2}, {index: 3}],
          hasNext: false
        })
      })

    },
    handleFilter() {
      console.log('handleFilter');
      this.show = true;
    },
    change(index) {
      console.log(index);
    },
    input() {
      console.log('input')
    },
    search() {
      console.log('search');
    },
  }
}
</script>

<style scoped>

</style>
